<template>
  <scroll-view class="channel-list" scroll-y>
    <view 
      v-for="channel in channels" 
      :key="channel.id" 
      class="channel-item"
      @click="selectChannel(channel)"
    >
      <image class="channel-logo" :src="channel.logo" mode="aspectFit"></image>
      <text class="channel-name">{{ channel.name }}</text>
    </view>
  </scroll-view>
</template>

<script>
export default {
  props: {
    channels: {
      type: Array,
      required: true
    }
  },
  methods: {
    selectChannel(channel) {
      this.$emit('select', channel)
    }
  }
}
</script>

<style scoped>
.channel-list {
  height: 100%;
  width: 200px;
  background-color: #f5f5f5;
}

.channel-item {
  padding: 10px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.channel-logo {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.channel-name {
  font-size: 14px;
}
</style>